from building import *
import os

cwd     = GetCurrentDir()

src = [cwd + '/robot.c']

path = [cwd]

if GetDepend(['BSP_USING_EXAMPLE_TASK']):
    src += Glob(cwd + '/example/*.c')
    path += [cwd + '/example']

if GetDepend(['BSP_USING_INS_TASK']):
    src += Glob(cwd + '/ins/*.c')
    path += [cwd + '/ins']

if GetDepend(['BSP_USING_MOTOR_TASK']):
    src += Glob(cwd + '/motor/*.c')
    path += [cwd + '/motor']

if GetDepend(['BSP_USING_CMD_TASK']):
    src += Glob(cwd + '/cmd/*.c')
    path += [cwd + '/cmd']

if GetDepend(['BSP_USING_CHASSIS_TASK']):
    src += Glob(cwd + '/chassis/*.c')
    path += [cwd + '/chassis']

if GetDepend(['BSP_USING_GIMBAL_TASK']):
    src += Glob(cwd + '/gimbal/*.c')
    path += [cwd + '/gimbal']

if GetDepend(['BSP_USING_TRANSMISSION_TASK']):
    src += Glob(cwd + '/transmission/*.c')
    path += [cwd + '/transmission']

if GetDepend(['BSP_USING_SHOOT_TASK']):
    src += Glob(cwd + '/shoot/*.c')
    path += [cwd + '/shoot']

group = DefineGroup('RM_Task', src, depend = [''], CPPPATH = path)

Return('group')
